package scaladuct

/**
 * <p>
 * Created by IntelliJ IDEA.
 * User: zslajchrt
 * Date: Aug 12, 2010
 * Time: 1:31:52 PM
 */

@serializable @SerialVersionUID(1L)
class MetaCookie(val properties: List[ArgPropertyValue[AnyRef]],
                 val firstArgumentIndex: Int,
                 val isCookieArgument: Boolean) {
  def contextProperties(): List[ArgPropertyValue[AnyRef]] = properties.take(firstArgumentIndex)

  def cookieProperties(): List[ArgPropertyValue[AnyRef]] = properties.drop(firstArgumentIndex)

  def property(propName: String): Option[ArgPropertyValue[AnyRef]] = properties.find(_.name.toLowerCase == propName.toLowerCase)
}

